﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="三分厂车丝统计.aspx.cs" Inherits="syc.Inspection.三分厂车丝统计" %>

<head runat="server">
    <title></title>
</head>
<body>
  <script type="text/javascript" language="javascript" src="/common.js"></script>

    <form id="form1" runat="server">
        <div id="wintop" class="wintop">三分厂车丝统计</div>
         <asp:Panel ID="Panel1" runat="server" CssClass="panel">
        <input type="button" value="录 入" class="button" onclick="parent.swin2_load('/Inspection/三分厂车丝统计录入.aspx',900,400);"/>
        </asp:Panel> 
        <asp:Panel ID="Panel2" runat="server" CssClass="panel" GroupingText="查 询">             
     工&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 段：<asp:DropDownList ID="GongDuan" runat="server" Width="120px">
    <asp:ListItem Value="0">全部</asp:ListItem>
    <asp:ListItem Value="1">甲班</asp:ListItem>
    <asp:ListItem Value="2">乙班</asp:ListItem>
    <asp:ListItem Value="3">丙班</asp:ListItem>
    <asp:ListItem Value="4">丁班</asp:ListItem>
</asp:DropDownList>
<span style="margin-left:24px;">&nbsp;</span>产&nbsp;&nbsp; &nbsp;&nbsp; 品：<asp:DropDownList ID="ChanPin" runat="server" Width="150px">
    <asp:ListItem Value="0">全部</asp:ListItem>
    <asp:ListItem Value="3">油管接箍光管(J55)</asp:ListItem>
    <asp:ListItem Value="4">套管接箍光管(J55)</asp:ListItem>
    <asp:ListItem Value="103">油管接箍光管(N80)</asp:ListItem>
    <asp:ListItem Value="104">套管接箍光管(N80)</asp:ListItem>
</asp:DropDownList>
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 机&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 床：<asp:DropDownList ID="JiChuang" runat="server" Width="120px">
                <asp:ListItem Value="0">全部</asp:ListItem>
                <asp:ListItem Value="1">1#</asp:ListItem>
                <asp:ListItem Value="2">2#</asp:ListItem>
                <asp:ListItem Value="3">3#</asp:ListItem>
                <asp:ListItem Value="4">4#</asp:ListItem>
                <asp:ListItem Value="5">5#</asp:ListItem>                
                <asp:ListItem Value="6">6#</asp:ListItem>
                <asp:ListItem Value="7">7#</asp:ListItem>
                <asp:ListItem Value="8">8#</asp:ListItem>
                <asp:ListItem Value="9">9#</asp:ListItem>
                <asp:ListItem Value="10">10#</asp:ListItem>                
                <asp:ListItem Value="11">11#</asp:ListItem>
                <asp:ListItem Value="12">12#</asp:ListItem>
                <asp:ListItem Value="13">13#</asp:ListItem>
                <asp:ListItem Value="14">14#</asp:ListItem>
                <asp:ListItem Value="15">15#</asp:ListItem>                
                <asp:ListItem Value="16">16#</asp:ListItem>
                <asp:ListItem Value="17">17#</asp:ListItem>
                <asp:ListItem Value="18">18#</asp:ListItem>
                <asp:ListItem Value="19">19#</asp:ListItem>
                <asp:ListItem Value="20">20#</asp:ListItem>
            </asp:DropDownList>
            <div style="font-size:6px;height:6px;line-height:6px;">
            </div>
            开始日期：<asp:TextBox ID="Date1" runat="server" CssClass="textbox" Width="120px"></asp:TextBox>
            <img align="middle" alt="" 
                onclick="makecalendar(document.getElementById('Date1').value, document.getElementById('Date1'));" 
                src="/Icons/29.png" />

<span style="margin-left:8px;"></span>
截止日期：<asp:TextBox ID="Date2" runat="server" CssClass="textbox" Width="120px"></asp:TextBox><img alt="" src="/Icons/29.png" align="middle" onclick="makecalendar(document.getElementById('Date2').value, document.getElementById('Date2'));" />

<span style="margin-left:5px;"></span><asp:Button ID="Button_Query" runat="server" Text="查 询" CssClass="mbutton" 
UseSubmitBehavior="False" onclick="Button_Query_Click" />
<asp:Button ID="Button_Reset" runat="server" Text="复 位" CssClass="mbutton" 
UseSubmitBehavior="False" onclick="Button_Reset_Click"  />
</asp:Panel>
    <div class="gridframe">
        <div class="gridview">
        
            <table border="1" width="100%" cellspacing="0" cellpadding="0" bordercolor="#e5cfab">
	            <tr>
		            <td class="grid-title">三分厂车丝统计<asp:SqlDataSource ID="SqlDataSource1" runat="server" 
                            ConnectionString="<%$ ConnectionStrings:SCMConnectionString1 %>" 
                           onselected="SqlDataSource1_Selected"
                            SelectCommand="SELECT * FROM [三分厂车丝统计] order by [日期] desc,[班次] asc" 
                            DeleteCommand="DELETE FROM [三分厂车丝统计] WHERE [ID] = @ID" 
                            UpdateCommand="update 三分厂车丝统计 SET  加工数=@加工数,合格数=@合格数,不合格数=@不合格数
                            WHERE [ID] = @ID"
                           >
                            <UpdateParameters>
                                <asp:Parameter Name="加工数" Type="Int32" />
                                <asp:Parameter Name="合格数" Type="Int32" />
                                <asp:Parameter Name="不合格数" Type="Int32" />
                                <asp:Parameter Name="ID" Type="Int32" />
                            </UpdateParameters>
                        </asp:SqlDataSource>
                    </td>
		        </tr>
		        <tr>
		            <td class="grid-back">
<asp:GridView ID="GridView1" runat="server" AllowPaging="True" 
AutoGenerateColumns="False" CssClass="grid" DataKeyNames="ID" 
DataSourceID="SqlDataSource1" 
GridLines="None" ondatabound="GridView1_DataBound" 
onpageindexchanged="GridView1_PageIndexChanged" AllowSorting="True" 
UseAccessibleHeader="False">
<PagerSettings Visible="False" />
<RowStyle CssClass="grid-row-normal" />
<Columns>
  <asp:TemplateField HeaderText="日期" SortExpression="日期">
      <ItemTemplate>
           <asp:Label ID="Label3" runat="server" Text='<%# Bind("日期","{0:D}") %>'></asp:Label>
            </ItemTemplate>
           <HeaderStyle CssClass="grid-header" />
      <ItemStyle CssClass="grid" HorizontalAlign="Center" Width="80px" />
    </asp:TemplateField>  
    <asp:TemplateField HeaderText="产品类型" SortExpression="产品类型 ">
        <ItemTemplate>
            <asp:Label ID="cp" runat="server" Text='<%# Eval("产品类型") %>'></asp:Label>
        </ItemTemplate>
        <HeaderStyle CssClass="grid-header" />
        <ItemStyle CssClass="grid" HorizontalAlign="Center" Width="50px" />
    </asp:TemplateField>
     <asp:TemplateField HeaderText="班次" SortExpression="班次 ">
        <ItemTemplate>
            <asp:Label ID="bc" runat="server" Text='<%# Eval("班次") %>'></asp:Label>
        </ItemTemplate>
        <HeaderStyle CssClass="grid-header" />
        <ItemStyle CssClass="grid" HorizontalAlign="Center" Width="50px" />
    </asp:TemplateField>
     <asp:TemplateField HeaderText="机床" SortExpression="机床 ">
        <ItemTemplate>
            <asp:Label ID="jc" runat="server" Text='<%# Eval("机床") %>'></asp:Label>
        </ItemTemplate>
        <HeaderStyle CssClass="grid-header" />
        <ItemStyle CssClass="grid" HorizontalAlign="Center" Width="50px" />
    </asp:TemplateField>      
     <asp:BoundField DataField="加工数"  HeaderText="加工数" >
        <HeaderStyle CssClass="grid-header"/>
        <ItemStyle CssClass="grid" Width="50px" HorizontalAlign="Right"/>
    </asp:BoundField>
    <asp:BoundField DataField="合格数"  HeaderText="合格数" >
        <HeaderStyle CssClass="grid-header"/>
        <ItemStyle CssClass="grid" Width="50px" HorizontalAlign="Right"/>
    </asp:BoundField>
     <asp:BoundField DataField="不合格数"  HeaderText="不合格数" >
        <HeaderStyle CssClass="grid-header"/>
        <ItemStyle CssClass="grid" Width="50px" HorizontalAlign="Right"/>
    </asp:BoundField>
      <asp:BoundField DataField="不合格原因"  HeaderText="不合格数原因" >
        <HeaderStyle CssClass="grid-header"/>
        <ItemStyle CssClass="grid" Width="150px" HorizontalAlign="Right"/>
    </asp:BoundField>
    <asp:BoundField DataField="供货单位"  HeaderText="供货单位" >
        <HeaderStyle CssClass="grid-header"/>
        <ItemStyle CssClass="grid" Width="150px" HorizontalAlign="Right"/>
    </asp:BoundField>
     <asp:TemplateField ShowHeader="False" >
        <ItemTemplate>
            <asp:Button ID="Button1" runat="server" CausesValidation="False" 
                CommandName="Edit" CssClass="smallbutton" Text="编辑" />
            <asp:Button ID="Button2" runat="server" CausesValidation="False" 
                CommandName="Delete" CssClass="smallbutton" Text="删除" />
        </ItemTemplate>
         <EditItemTemplate>
             <asp:Button ID="Button1" runat="server" CausesValidation="True" 
                 CommandName="Update" CssClass="smallbutton" Text="更新" />
             <asp:Button ID="Button2" runat="server" CausesValidation="False" 
                 CommandName="Cancel" CssClass="smallbutton" Text="取消" />
         </EditItemTemplate>
        <ItemStyle CssClass="smallbutton" />
    </asp:TemplateField>
</Columns>
</asp:GridView>
		                
		            </td>
	            </tr>
	             <tr>
	            <td>   
                    <table width="100%">
                        <tr>
                            <td class="pagebar">
                                <asp:Button ID="Button_Pager_First" runat="server" Text="" ToolTip="首页" UseSubmitBehavior="false"
                                    CssClass="pageturn-first-b" onclick="Pager_Click" CommandName="--" />
                                <asp:Button ID="Button_Pager_Prev" runat="server" Text="" ToolTip="上一页"  UseSubmitBehavior="false"
                                    CssClass="pageturn-prev-b" onclick="Pager_Click" CommandName="-" />
                                <input type="button" class="page-split" />第<asp:TextBox ID="TextBox_Pager" runat="server" CssClass="pageturn" 
                                    ontextchanged="Pager_Click" AutoPostBack="true"></asp:TextBox>页<input type="button" class="page-split" /><asp:Label ID="Label_Pages" runat="server"></asp:Label><input type="button" class="page-split" />
                                
                                <asp:Button ID="Button_Pager_Next" runat="server" Text="" ToolTip="下一页"  UseSubmitBehavior="false"
                                    CssClass="pageturn-next-b" onclick="Pager_Click" CommandName="+" />
                                <asp:Button ID="Button_Pager_Last" runat="server" Text="" ToolTip="末页"  UseSubmitBehavior="false"
                                    CssClass="pageturn-last-b" onclick="Pager_Click" CommandName="++" />
                            </td>
                            <td class="pagebar" align="right">
                                <asp:Label ID="Label_Total" runat="server" Text=""></asp:Label>
                            </td>
                        </tr>
                    </table>

		            </td>
	            </tr>
            </table>
            

        </div>
    </div>
    
    </form>
<script>
    var textboxs = document.getElementsByTagName("input");
    var i;
    for (i = 0; i < textboxs.length; i++) {
        if (textboxs[i].className == "textbox") {
            textboxs[i].onchange = function(e) { this.className = "textbox-changed"; };
            textboxs[i].onfocus = function(e) { this.select(); };
        }
        else if (textboxs[i].className == "pageturn") {
            textboxs[i].onfocus = function(e) { this.select(); };
        }

    }
    var rows = document.getElementsByTagName("tr");
    for (i = 0; i < rows.length; i++) {

        if (rows[i].className == "grid-row-normal") {
            rows[i].onmouseover = function() { this.className = "grid-row-bright"; };
            rows[i].onmouseout = function() { this.className = "grid-row-normal"; };
        }
    }
    var tds = document.getElementsByTagName("td");
    for (i = 0; i < tds.length; i++) {
        if (tds[i].className == "detailheader") {
            tds[i].innerHTML = tds[i].innerHTML.replace("*", "<span class=required>*</span>");
        }
    }
</script>
</body>
</html>
